Apply max concurrent chunk uploads retrieved from server capabilities
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 20 Jan 2025 09:56:52 +0000 (17:56 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 23 Jan 2025 02:13:51 +0000 (10:13 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/folder.cpp

index 54a08ec2e8f542e29888b18fcea1121b404e70cc..d68a2196367f9cf787b11be40521f06d09641fc2 100644 (file)
@@ -1151,7 +1151,11 @@ SyncOptions Folder::initializeSyncOptions() const
     opt._confirmExternalStorage = cfgFile.confirmExternalStorage();
     opt._moveFilesToTrash = cfgFile.moveToTrash();
     opt._vfs = _vfs;
-    opt._parallelNetworkJobs = account->isHttp2Supported() ? 20 : 6;
+
+    const auto capsMaxConcurrentChunkUploads = account->capabilities().maxConcurrentChunkUploads();
+    opt._parallelNetworkJobs = capsMaxConcurrentChunkUploads > 0
+        ? capsMaxConcurrentChunkUploads
+        : account->isHttp2Supported() ? 20 : 6;
 
     // Chunk V2: Size of chunks must be between 5MB and 5GB, except for the last chunk which can be smaller
     const auto cfgMinChunkSize = cfgFile.minChunkSize();